import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  // state
  const name = ref('tom')
  const age = ref('22')

  // getter
  const info = computed(() => `姓名：${name.value}，年龄：${age.value}`)
 

  // action
  function grow(){
    age.value++
  }
  

  return { name, age, info, grow }
})
